// reducer 纯函数
export const countReducer = (state = { num: 1 }, action) => {
  // console.log(state, action);
  switch (action.type) {
    case "increment":
      return { ...state, num: state.num + action.step };
    case "decrement":
      return { ...state, num: state.num - action.step };
    default:
      return state;
  }
};
